/*
package cn.yr.common.exception.filter;

import org.springframework.stereotype.Component;

import javax.servlet.*;
import java.io.IOException;

*/
/**
 * @ClassName : ExceptionFilter
 * @Description : 捕获Filter中异常 转发到Controller（GlobalExceptionHandler 无法捕获Filter中异常）
 * @Author : Lang
 * @Date: 2020-06-23 09:18
 *//*

@Component
public class ExceptionFilter implements Filter {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        try {
            chain.doFilter(request, response);
        } catch (Exception e) {
            // 异常捕获，发送到error controller
            request.setAttribute("filter.exception", e);
            //将异常分发到/error/exthrow控制器
            request.getRequestDispatcher("/exception/throw").forward(request, response);
        }
    }
}

*/
